<template>
    <div class="header_box">
        <div class="header_content">
            <router-link to="/home"><img src="/public/resource.png" alt="图片丢失" title="分享之家" class="header_log"></router-link>
            <HeaderMean></HeaderMean>
            <HeaderOperate @log-register="logRegister"></HeaderOperate>
        </div>
        <div class="header_load" v-if="store.state.headerLoad"></div>
    </div>
</template>
<!--导航栏-->
<script setup>
import HeaderMean from "@/components/header/HeaderMean.vue";
import HeaderOperate from "@/components/header/HeaderOperate.vue";
import {ref} from "vue";
import store from "@/store/index.js";

//emit事件
const emit = defineEmits(['logRegister']);

//打开登录注册窗口
const logRegister = (item) => {
    emit('logRegister', item);
};


</script>

<style scoped>
.header_box{
   position: fixed;
    top: 0;
    width: 100%;
    z-index: 999;
    animation: header_box .5s ease-in-out 0s 1 forwards;
    opacity: 0;
}
.header_content {
    width: 100%;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 4px rgba(87, 83, 83, 0.4);
    background: var(--body-color);
}

@keyframes header_box {
    0% {
        opacity: 0;
        transform: translateY(-100px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.header_content img{
    width: 120px;
}

.header_log {
    width: 50px;
}

.header_load {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: #6da6e1;
    z-index: 999;
    transition: all .3s;
    animation: header_content 1s ease-in 0s 1 forwards;
}


@keyframes header_content {
    0% {
        width: 0;
    }
    100% {
        width: 99%;
    }
}


</style>